package com.ming.demo.web.impl;

import com.ming.demo.bean.Result;
import com.ming.demo.model.InfoPeople;
import com.ming.demo.service.InfoPeopleService;
import com.ming.demo.web.InfoPeopleController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/infoPeople")
public class InfoPeopleControllerImpl implements InfoPeopleController {
    @Autowired
    private InfoPeopleService infoPeopleService;



    @Override
    @ResponseBody
    @RequestMapping("/insertIntoInfoPeople")
    public InfoPeople insertInToInfoPeople(InfoPeople infoPeople) {
        Result<String> result = new Result<>();
        result.setCode("200");
        InfoPeople infoPeople1 = infoPeopleService.insertIntoPeople(infoPeople);
        if(infoPeople1 != null){
            return infoPeople1;
        }else{
            return null;
        }
    }
}
